<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" href="../mdui/css/mdui.min.css">
    <script defer src="../mdui/js/mdui.min.js"></script>
    <script src="../js/axios.min.js"></script>
    <script src="../js/qs.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/vue.js"></script>
    <style>
        .mdui-table {
            width: 1000px;
        }
    </style>
</head>
<body class="mdui-theme-primary-indigo mdui-theme-accent-green">
<div class="mdui-container-fluid" id="app">
    <h1 class="mdui-text-color-theme ">宿舍水电缴费情况</h1>
    <div>
        <table class="mdui-table mdui-table-hoverable">
            <thead>
            <tr>
                <th>宿舍</th>
                <th>水费</th>
                <th>电费</th>
                <th>缴费时间</th>
            </tr>
            </thead>
            <tbody>
            <tr v-for="(d,index) in doors">
                <td>{{d.name}}</td>
                <td>{{d.water}}</td>
                <td>{{d.power}}</td>
                <td>{{d.date}}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            id: '',
            place: '',
            doors: [],
        },
        created() {
            this.findDoors();
        },
        methods: {
            findDoors() {
                let _this = this;
                axios
                    .get("/door/list")
                    .then(function (res) {
                        _this.doors = res.data;
                    })
            }
        }
    })
</script>
</body>
</html>